$(function () {
    selectMember()
});
layui.use("layer");

function selectMember() {
    let id = sessionStorage.getItem("groupId");
    let result = myAjax('/g/group/selectMember', 'get', {id: id});
    if (result.code === 200) {
        showMember(result.data);
    } else {
        layer.msg("查询失败");
    }
}

function showMember(data) {
    let html = "";
    let html1 = "";
    for (let i = 0; i < data.length; i++) {
        if (i <= 3) {
            html += '<div style="text-align: center"><div class="layui-anim layui-anim-rotate" style="width: 100px;' +
                'height: 100px;border-radius: 50px;' +
                'border: 1px solid red;margin: 10px">' +
                '<img width="100%" height="100%" style="border-radius: 50px" src="/img/register.jpg"></div>' +
                '<div>' + data[i].nickName + '</div></div>'

        } else if (i <= 7) {
            html1 += '<div style="text-align: center"><div class="layui-anim layui-anim-rotate" style="width: 100px;' +
                'height: 100px;border-radius: 50px;' +
                'border: 1px solid red;margin: 10px">' +
                '<img width="100%" height="100%" style="border-radius: 50px" src="/img/register.jpg"></div>' +
                '<div>' + data[i].nickName + '</div></div>'
        }
    }
    $("#member1").html(html);
    $("#member2").html(html1);
}